package com.iss.airsys.service;

import com.iss.airsys.dao.UserDao;
import com.iss.airsys.entity.User;
import com.iss.airsys.entity.Userinfo;
import com.iss.airsys.model.UserWithRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
   @Autowired
    private UserDao dao;
    public UserWithRole selectUser(User user){
        return dao.selectUser(user);
    }

    public boolean CheckUserName(String u_name){
        User user = dao.CheckUserName(u_name);
        if(user==null){
            return false;
        }else{
            return true;
        }
    }

    public int SubmitRegisterInfo(User user){

        return dao.addUser(user);
    }

    public int updateUser(@Param("u_name") String uInfo_name, @Param("u_pwd")String uInfo_pwd){
       return dao.updateUser(uInfo_name,uInfo_pwd);
    }

    public String selectuserInfoByphone(String uInfo_phone){
        return dao.selectuserInfoByphone(uInfo_phone);
    }
}
